<?php if(!defined('WANYA_ROOT')) {exit('error!');} ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Language" content="zh-CN" />
	<meta name="author" content="emlog" />
	<meta name="robots" content="noindex, nofollow">
	<meta http-equiv="X-UA-Compatible" content="IE=8" />
	<title>管理中心 - Seer音乐教育</title>
	<link href="./views/style/<?php echo Option::get('admin_style');?>/style.css?v=<?php echo Option::EMLOG_VERSION; ?>" type=text/css rel=stylesheet>
	<link href="./views/css/css-main.css?v=<?php echo Option::EMLOG_VERSION; ?>" type=text/css rel=stylesheet>
	<script type="text/javascript" src="../include/lib/js/jquery/jquery-1.7.1.js?v=<?php echo Option::EMLOG_VERSION; ?>"></script>
	<script type="text/javascript" src="../include/lib/js/jquery/plugin-cookie.js?v=<?php echo Option::EMLOG_VERSION; ?>"></script>
	<script type="text/javascript" src="./views/js/common.js?v=<?php echo Option::EMLOG_VERSION; ?>"></script>

</head>
<body>
<?php
if($tableID=="user" )
{
?>
<div style="width:80%;margin-left:auto;margin-right:auto;">
<div class=containertitle><b>用户选择</b>
</div>
<div class=line></div>
<form action="popup.php?tableID=user&idObj=<?php echo $idObj;?>&nameObj=<?php echo $nameObj;?>" method="post" name="form_user" id="form_user">
	<fieldset style="border:2px solid #0099ff;">
		<legend>检索条件</legend>
		<table style="margin-bottom: 5px;margin-left: 10px">
		<tr>
			<td>电话：</td><td><input type="text" name="tel" value="<?php echo($tel);?>"></td><td>　　<input type="button" value="检索" class="button" onclick="commitUserSelect();"></td><td>　　<input type="button" value="取消" class="button" onclick="cancle();"></td>
		</tr>
	</table>
		</fieldset>
	<br>
  <table width="100%" id="adm_comment_list" class="item_list">
  	<thead>
      <tr>
        <th width="200" colspan="1"><b>姓名</b></th>
		<th width="300"><b>电话</b></th>
		<th width="300"><b>注册时间</b></th>
      </tr>
    </thead>
    <tbody>
	<?php
	if($users):
	foreach($users as $key=>$value):
	?>
     <tr>
		<td><a href="javascript:setParentValue('<?php echo $value['wx_openid']; ?>','<?php echo $value['name']; ?>','<?php echo $value['tel']; ?>');"><?php echo $value['name']; ?></a></td>
 		<td><?php echo $value['tel']; ?></td>
		<td><?php echo $value['buildtime']; ?></td>
	<?php endforeach;else:?>
	  <tr><td class="tdcenter" colspan="4">还没有注册用户</td></tr>
	<?php endif;?>
	</tbody>
  </table>
	<div class="page"><?php echo $pageurl; ?> (共有<?php echo $usersNum; ?>位用户)</div>
</form>
	</div>
<?php }
else if($tableID=="student")
{ ?>
	<div style="width:80%;margin-left:auto;margin-right:auto;">
		<div class=containertitle><b>学生选择</b>
		</div>
		<div class=line></div>
		<form action="popup.php?tableID=student&idObj=<?php echo $idObj;?>&nameObj=<?php echo $nameObj;?>" method="post" name="form_user" id="form_user">

			<fieldset style="border:2px solid #0099ff;">
				<legend>检索条件</legend>
				<table style="margin-bottom: 5px;margin-left: 10px">
				<tr>
					<td>电话：</td><td><input type="text" name="tel" value="<?php echo($tel);?>"></td>
					<td>　　<input type="button" value="检索" class="button" onclick="commitUserSelect();"></td>
					<td>　　<input type="button" value="取消" class="button" onclick="cancle();"></td>
				</tr>
			</table>
				</fieldset>
			<br>
			<table width="100%" id="adm_comment_list" class="item_list">
				<thead>
				<tr>
					<th width="200" colspan="1"><b>姓名</b></th>
					<th width="300"><b>电话</b></th>
					<th width="300"><b>注册时间</b></th>
				</tr>
				</thead>
				<tbody>
				<?php
				if($users):
					foreach($users as $key=>$value):
						?>
						<tr>
						<td><a href="javascript:setParentValue('<?php echo $value['ID']; ?>','<?php echo $value['name']; ?>','<?php echo $value['tel']; ?>');"><?php echo $value['name']; ?></a></td>
						<td><?php echo $value['tel']; ?></td>
						<td><?php echo $value['buildtime']; ?></td>
					<?php endforeach;else:?>
					<tr><td class="tdcenter" colspan="4">还没有学生</td></tr>
				<?php endif;?>
				</tbody>
			</table>
			<div class="page"><?php echo $pageurl; ?> (共有<?php echo $usersNum; ?>位学生)</div>
		</form>
	</div>
<?php
}
else
{?>
	<div style="width:80%;margin-left:auto;margin-right:auto;">
		<div class=containertitle><b><?php echo $pwd;?>选择</b>
		</div>
		<div class=line></div>
		<form action="popup.php?tableID=<?php echo $tableID;?>&idObj=<?php echo $idObj;?>&nameObj=<?php echo $nameObj;?>" method="post" name="form_popup" id="form_popup">
			<fieldset style="border:2px solid #0099ff;">
				<legend>检索条件</legend>
				<table style="margin-bottom: 5px;margin-left: 10px">
				<tr>
					<td><?php echo $pwd;?>名称：</td><td><input type="text" name="name" value="<?php echo($name);?>"></td>
					<td>　　<input type="button" value="检索" class="button" onclick="commitPopupSelect();"></td>
					<td>　　<input type="button" value="取消" class="button" onclick="cancle();"></td>
				</tr>
			</table>
				</fieldset>
			<br>
			<table width="100%" id="adm_comment_list" class="item_list">
				<thead>
				<tr>
					<th width="20" colspan="1"><b>编号</b></th>
					<th width="200" colspan="1"><b><?php echo $pwd;?>姓名</b></th>
				</tr>
				</thead>
				<tbody>
				<?php
				if($popupDatas):
					for($i=0;$i<count($popupDatas);$i++){
						?>
						<tr>
						<td><?php echo ($page-1)*10+$i+1;; ?></td>
						<td><a href="javascript:setParentValue('<?php echo $popupDatas[$i]['ID']; ?>','<?php echo $popupDatas[$i]['name']; ?>','');"><?php echo $popupDatas[$i]['name']; ?></a></td>
					<?php };else:?>
					<tr><td class="tdcenter" colspan="4">还没有<?php echo $pwd;?></td></tr>
				<?php endif;?>
				</tbody>
			</table>
			<div class="page"><?php echo $pageurl; ?> (共有<?php echo $popupDataNum."个".$pwd; ?>)</div>
		</form>
	</div>
<?php }?>
</body>

<script>
$(document).ready(function(){
	$("#adm_comment_list tbody tr:odd").addClass("tralt_b");
	$("#adm_comment_list tbody tr")
		.mouseover(function(){$(this).addClass("trover");$(this).find("span").show();})
		.mouseout(function(){$(this).removeClass("trover");$(this).find("span").hide();})
});
setTimeout(hideActived,2600);
function setParentValue(id,name,telVal)
{
	window.opener.document.getElementById("<?php echo($idObj);?>").value = id;
	window.opener.document.getElementById("<?php echo($nameObj);?>").value = name;
	var name2=	window.opener.document.getElementById("<?php echo($nameObj);?>"+"2");
	var tel=	window.opener.document.getElementById("<?php echo($idObj);?>"+"_tel");
	var tel2=	window.opener.document.getElementById("<?php echo($idObj);?>"+"_tel2");
	if(name2!=null)
	{
		name2.value = name;
	}
	if(tel!=null)
	{
		tel.value = telVal;
	}
	if(tel2!=null)
	{
		tel2.value = telVal;
	}
	window.opener = null;
	window.close();
}
function cancle()
{
	window.opener.document.getElementById("<?php echo($idObj);?>").value = "";
	window.opener.document.getElementById("<?php echo($nameObj);?>").value = "";
	var name2=	window.opener.document.getElementById("<?php echo($nameObj);?>"+"2");
	var tel=	window.opener.document.getElementById("<?php echo($idObj);?>"+"_tel");
	var tel2=	window.opener.document.getElementById("<?php echo($idObj);?>"+"_tel2");
	if(name2!=null)
	{
		name2.value = "";
	}
	if(tel!=null)
	{
		tel.value = "";
	}
	if(tel2!=null)
	{
		tel2.value = "";
	}
	window.opener = null;
	window.close();
}
function commitUserSelect(){
	$("#form_user").submit();
}
function commitPopupSelect(){
	$("#form_popup").submit();
}
$("#menu_cm").addClass('sidebarsubmenu1');
</script>